/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-07 13:44:19  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import static javax.persistence.GenerationType.IDENTITY;
import java.util.Set;
import java.util.LinkedHashSet;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.EntityListeners;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "wwyt_bp_emergency_material")
@SQLDelete(sql="update wwyt_bp_emergency_material set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql="update wwyt_bp_emergency_material set DELETE_FLAG = '1' where id= ?")
@Where(clause="DELETE_FLAG = '0'")

public class BpEmergencyMaterial implements java.io.Serializable{
    
    //columns START
    //ID，主键
    private Long id;
    //物资名称
    private String name;
    //物资编号
    private String code;
    //物资型号
    private String materialModel;
    //数量
    private Integer materialNumber;
    //存放地点ID
    private Long storageLocationId;
    //保存状态
    /**
     * 1.完好
     * 2.维修中
     */
    private Integer state;
    //物资类型ID
    private Long materialTypeId;
    //用途
    private String purpose;
    //生产日期
    private java.util.Date manufactureTime;
    //到期日期
    private java.util.Date expireTime;
    //购入日期
    private java.util.Date payTime;
    //投用日期
    private java.util.Date useTime;
    //制造厂家
    private String manufacturer;
    //所属单位
    private String subordinateUnits;
    //是否可回收（0:是，1:否）
    private Integer isRecyclable;
    //备注
    private String remark;
    //创建人
    private Long createBy;
    //创建时间
    private java.util.Date createTime;
    //更新人
    private Long updateBy;
    //更新时间
    private java.util.Date updateTime;
    //删除标记
    private String deleteFlag;
    //组织机构代码
    private String orgCode;
    //租户
    private Long tenentId;
    //columns END


    public void setId(Long value) {
        this.id = value;
    }
    
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }
    
     
    @Column(name = "NAME", length = 100)
    public String getName() {
        return this.name;
    }
    
    public void setName(String value) {
        this.name = value;
    }
    
     
    @Column(name = "CODE", length = 10)
    public String getCode() {
        return this.code;
    }
    
    public void setCode(String value) {
        this.code = value;
    }
    
     
    @Column(name = "MATERIAL_MODEL", length = 100)
    public String getMaterialModel() {
        return this.materialModel;
    }
    
    public void setMaterialModel(String value) {
        this.materialModel = value;
    }
    
     
    @Column(name = "MATERIAL_NUMBER")
    public Integer getMaterialNumber() {
        return this.materialNumber;
    }
    
    public void setMaterialNumber(Integer value) {
        this.materialNumber = value;
    }
    
     
    @Column(name = "STORAGE_LOCATION_ID")
    public Long getStorageLocationId() {
        return this.storageLocationId;
    }
    
    public void setStorageLocationId(Long value) {
        this.storageLocationId = value;
    }
    
     
    @Column(name = "STATE")
    public Integer getState() {
        return this.state;
    }
    
    public void setState(Integer value) {
        this.state = value;
    }
    
     
    @Column(name = "MATERIAL_TYPE_ID")
    public Long getMaterialTypeId() {
        return this.materialTypeId;
    }
    
    public void setMaterialTypeId(Long value) {
        this.materialTypeId = value;
    }
    
     
    @Column(name = "PURPOSE", length = 500)
    public String getPurpose() {
        return this.purpose;
    }
    
    public void setPurpose(String value) {
        this.purpose = value;
    }
    
     
    @Column(name = "MANUFACTURE_TIME")
    public java.util.Date getManufactureTime() {
        return this.manufactureTime;
    }
    
    public void setManufactureTime(java.util.Date value) {
        this.manufactureTime = value;
    }
    
     
    @Column(name = "EXPIRE_TIME")
    public java.util.Date getExpireTime() {
        return this.expireTime;
    }
    
    public void setExpireTime(java.util.Date value) {
        this.expireTime = value;
    }
    
     
    @Column(name = "PAY_TIME")
    public java.util.Date getPayTime() {
        return this.payTime;
    }
    
    public void setPayTime(java.util.Date value) {
        this.payTime = value;
    }
    
     
    @Column(name = "USE_TIME")
    public java.util.Date getUseTime() {
        return this.useTime;
    }
    
    public void setUseTime(java.util.Date value) {
        this.useTime = value;
    }
    
     
    @Column(name = "MANUFACTURER", length = 200)
    public String getManufacturer() {
        return this.manufacturer;
    }
    
    public void setManufacturer(String value) {
        this.manufacturer = value;
    }
    
     
    @Column(name = "SUBORDINATE_UNITS", length = 200)
    public String getSubordinateUnits() {
        return this.subordinateUnits;
    }
    
    public void setSubordinateUnits(String value) {
        this.subordinateUnits = value;
    }
    
     
    @Column(name = "IS_RECYCLABLE")
    public Integer getIsRecyclable() {
        return this.isRecyclable;
    }
    
    public void setIsRecyclable(Integer value) {
        this.isRecyclable = value;
    }
    
     
    @Column(name = "REMARK", length = 200)
    public String getRemark() {
        return this.remark;
    }
    
    public void setRemark(String value) {
        this.remark = value;
    }
    
     
    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }
    
    public void setCreateBy(Long value) {
        this.createBy = value;
    }
    
     
    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }
    
     
    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }
    
    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }
    
     
    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }
    
    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }
    
     
    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }
    
    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }
    
     
    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }
    
    public void setOrgCode(String value) {
        this.orgCode = value;
    }
    
     
    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }
    
    public void setTenentId(Long value) {
        this.tenentId = value;
    }
    

    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id",getId())
            .append("name",getName())
            .append("code",getCode())
            .append("materialModel",getMaterialModel())
            .append("materialNumber",getMaterialNumber())
            .append("storageLocationId",getStorageLocationId())
            .append("state",getState())
            .append("materialTypeId",getMaterialTypeId())
            .append("purpose",getPurpose())
            .append("manufactureTime",getManufactureTime())
            .append("expireTime",getExpireTime())
            .append("payTime",getPayTime())
            .append("useTime",getUseTime())
            .append("manufacturer",getManufacturer())
            .append("subordinateUnits",getSubordinateUnits())
            .append("isRecyclable",getIsRecyclable())
            .append("remark",getRemark())
            .append("createBy",getCreateBy())
            .append("createTime",getCreateTime())
            .append("updateBy",getUpdateBy())
            .append("updateTime",getUpdateTime())
            .append("deleteFlag",getDeleteFlag())
            .append("orgCode",getOrgCode())
            .append("tenentId",getTenentId())
            .toString();
    }
    
    public int hashCode() {
        return new HashCodeBuilder()
            .append(getId())
            .toHashCode();
    }
    
    public boolean equals(Object obj) {
        if(obj instanceof BpEmergencyMaterial == false) return false;
        if(this == obj) return true;
        BpEmergencyMaterial other = (BpEmergencyMaterial)obj;
        return new EqualsBuilder()
            .append(getId(),other.getId())
            .isEquals();
    }
}

